
<?php echo $this->form ?>


<h2> Informationen Kind</h2>
<div id="child">
<table>
     <caption> Kind </caption>
    <thead>
    <tr>
        <th>Feld</th>
        <th>Daten</th>
    </tr>
    </thead>
    <tbody>
	<tr>
	    <td>Vorname</td> <td><?php echo $this->children['forename'] ?></td>
	</tr>
	<tr>
	    <td>Nachname</td> <td><?php echo $this->children['surname'] ?></td>
	</tr>
	<tr>
	    <td>Geschlecht</td> <td><?php echo $this->children['gender'] ?></td>
	</tr>
	<tr>
	    <td>Alter</td>   <td><?php echo $this->children['age'] ?></td>
	</tr>
	<tr>
	    <td>Geburtstag</td> <td><?php echo $this->children['birthday'] ?></td>
	</tr>
	<tr>
	    <td>Ranking Punkte</td> <td><?php echo $this->children['ranking_points'] ?></td>
	</tr>
	<tr>
	    <td>Kommentar</td> <td width="500px"><?php echo $this->children['comment'] ?></td>
	</tr>
	
	</tbody>
	
</table>
<a href="/child/update/id/<?php echo $this->children['id'] ?>/from/<?php echo $from = $this->request_from ?>">Kind Daten ändern</a>
</div>

<div id="parent">
    <?php if (isset($this->parents) && count($this->parents) > 0) : ?>
        <table>
    	<caption> Eltern </caption>
    	<thead>
    	    <tr>
    		<th>Vorname</th>
    		<th>Nachname</th>
    		<th>Telefonnummer</th>
    		<th>Mobile-Nummer</th>
    	    </tr>
    	</thead>
    	<tbody>
		<?php foreach ($this->parents as $parent) : ?>
		    <tr>
			<td><?php echo $parent['forename'] ?></td>
			<td><?php echo $parent['surname'] ?></td>
			<td><?php echo $parent['telnumber'] ?></td>
			<td><?php echo $parent['mobilenumber'] ?></td>
		    <?php endforeach; ?>
    	</tbody>
	<?php endif ?>
    </table>
</div>
<p></p>
<div id="events">
     <?php if (isset($this->events) && count($this->events) > 0) : ?> 
        <table>

    	<caption> Nächsten 5 Termine</caption>
    	<thead>
    	    <tr>
    		<th>Datum</th>
      		<th>Wochentag</th>
    		<th>Uhrzeit</th>
    		<th>Termin Typ</th>
    		<th>Status</th>
    	    </tr>
    	</thead>
	    <?php for ($i = 0; $i < 5 != NULL; $i++){
		
		$event = $this->events[$i];
		if  ($event['date_from'] == NULL){break;};  	
		$weekday = array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "SSonntag");
		$day = strtotime($event['date_from']);

		$start_date = date("d-m-Y", strtotime($event['date_from']));
		$end_date = date("d-m-Y", strtotime($event['date_to']));
		$start_time = date("H:i", strtotime($event['date_from']));
		$end_time = date("H:i", strtotime($event['date_to']));

		if ($event['idevent_series'] > 0)
		{
		    $rythmus = "Wöchentlich";
		} else
		{
		    $rythmus = " ";
		}
		?>
		<tr>
		    <td><?php echo $start_date ?></td>
		    <td><?php echo $weekday[date("w", $day)] ?></td>
		    <td><?php echo $start_time ?> bis <?php echo $end_time ?></td>
		    <td><?php echo $event['event_type'] ?></td>
		    <td><?php echo $event['event_status'] ?></td>
		</tr>
 <?php if  ($event['date_from'] == NULL){break;};  ?>	
 <?php }?>
	<?php endif ?>   
    </table
</div>
    <a href="/child/report/id/<?php echo $this->children['id'] ?>">Zum Kind Report</a>